package com.testin.utils;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.*;

public class Test 
{
    public static void main(String[] args){
    	String url = "http://www.baidu.com";
		
		int flag=0;//0是可以访问，1表示不能访问
	
	   	try   { 
	   	    	
    			URL   ruteUrl   =   new   URL(url);        	
    			HttpURLConnection con = (HttpURLConnection) ruteUrl.openConnection();
    
    			if("application/x-itunes-ipa".equals(con.getContentType())||"application/vnd.android.package-archive".equals(con.getContentType())){
    				
    			}
    			con.getContentLength();
    			System.out.print("===="+con.getContentType());
    			System.out.print("===="+con.getContentLength());
    		  // System.out.print("===="+	ruteCon.getContentLength());
    		}   catch   (Exception e)   { 
    		e.printStackTrace();
            }

    	}
}   